package com.proposition.exam.service;

import com.baomidou.mybatisplus.plugins.Page;
import com.proposition.commons.exam.bean.ExamPaperSearchItem;
import com.proposition.commons.exam.bean.ExamSearchItem;
import com.proposition.commons.exam.result.Result;
import com.proposition.commons.exam.vo.ExamVO;
import com.proposition.commons.model.*;
import freemarker.template.TemplateException;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URISyntaxException;

/**
 * @author: 陈玉林
 * @modifiedBy:
 * @date: Create In 16:36 2017/12/5
 * @description:
 */
public interface IServiceExamManage {
    /**
     * 获取试题列表
     *
     * @param page
     * @param searchItem
     * @return
     */
    Page<ExamVO> selectExamPage(Page<ExamVO> page, ExamSearchItem searchItem);
    /**
     * 获取试题列表
     *
     * @param page
     * @param searchItem
     * @return
     */
    Page<ExamVO> selectExamPaperPage(Page<ExamVO> page, ExamPaperSearchItem searchItem);

    /**
     * 试题详情
     *
     * @param id
     * @return
     */
    ModelAndView getExamDetail(String id);

    /**
     * @author: 陈玉林
     * @date: 2017/12/7 17:26
     * @description: 试题更新
     */
    ModelAndView intoUpdatePage(String id);

    /**
     * 试题修改-问答题-腧穴
     *
     * @param answer
     * @param answerScore
     *@param answer1
     * @param answerScore1
     * @param exam
     * @param check1   @return
     */
    Result updateExamAcupoint(String[] answer, Float[] answerScore, String[] answer1, Float[] answerScore1, ExamAcupoint exam, ExamAcupointCheck1 check1);

    /**
     * 试题修改-穴位定位-成人穴位
     *
     * @param answer
     * @param answerScore
     *@param exam
     * @param check1   @return
     */
    Result updateExamAcupointAdult(String[] answer, Float[] answerScore, ExamAcupointAdult exam, ExamAcupointAdultCheck1 check1);
    /**
     * 试题修改-穴位定位-成人穴位
     *
     * @param answer
     * @param answerScore
     *@param exam
     * @param check1   @return
     */
    Result updateExamAcupointPediatric(String[] answer, Float[] answerScore, ExamAcupointPediatric exam, ExamAcupointPediatricCheck1 check1);

    /**
     * 试题修改-问答题-妇、伤、儿、内、触诊
     *
     *
     * @param answer
     * @param answerScore
     *@param exam
     * @param check1   @return
     */
    Result updateExamWendaFSENC(String[] answer, Float[] answerScore, ExamAnswer10 exam, ExamAnswer10Check1 check1);
    /**
     * 试题修改-单项手法-成人手法、儿科手法、触诊诊断
     *
     * @param answer
     * @param answerScore
     *@param exam
     * @param check1   @return
     */
    Result updateExamSinglePloy(String[] answer, Float[] answerScore, ExamAnswer10 exam, ExamAnswer10Check1 check1);

    /**
     * 试题修改-成套手法-妇科、儿科、伤科、内科
     *
     * @param answer
     * @param answerScore
     *@param exam
     * @param check1   @return
     */
    Result updateExamCompletePloy(String[] answer, Float[] answerScore, ExamAnswer30 exam, ExamAnswer30Check1 check1);

    /**
     *@author: 陈玉林 
     *@date: 2017/12/12 9:16 
     *@description: 试题审核
     */
    Result checkExam(String id, Integer checkStatusId, String checkRemark);

   /**
    *@author: 陈玉林 
    *@date: 2017/12/12 11:24 
    *@description: 撤销审核
    */
    Result checkExamCancel(String id, Integer checkStatusId);

    /**
     *@author: 陈玉林 
     *@date: 2017/12/12 16:14 
     *@description: 试题删除
     * 同事删除终极表、一审表和original表
     */
    Result deleteExam(String id);

    /**
     *@author: 陈玉林 
     *@date: 2017/12/13 14:24 
     *@description: 试题导出
     */
     void writeExamToWord(String[] checkedId, HttpServletRequest request, HttpServletResponse response) throws IOException, TemplateException, URISyntaxException ;

    Result getExamById(String id);

    /**
     *@author: 陈玉林 
     *@date: 2018/1/2 9:56 
     *@description: 设置为客观化
     */
    Result setToObjective(String id);
    /**
     *@author: 陈玉林
     *@date: 2018/1/2 9:56
     *@description: 取消客观化
     */
    Result cancelObjective(String id);
/**
 *@author: 陈玉林 
 *@date: 2018/4/26 9:00
 *@description: 管理员可以看所有试题
 */
    Page<ExamVO> selectAdminExamPage(Page page, ExamSearchItem searchItem);
}
